﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Asignatura.master" AutoEventWireup="true" CodeBehind="AsignaturaMuro.aspx.cs" Inherits="eCampusWeb.AsignaturaMuro" %>
<%@ MasterType VirtualPath="~/Asignatura.master"%>
<asp:Content ID="Content2" ContentPlaceHolderID="HeadContent" runat="server">
<script type="text/javascript">

    function borrar(id) {
        if (confirm('¿Desea eliminar este comentario?')) {
            __doPostBack('BORRAR', id);
        }
    }

</script>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="Contenedor" runat="server">
<div style="text-align: center" > <asp:Label ID="lbError" runat="server" 
                style="font-weight: 700; color: #FF0000"></asp:Label></div>
                
<div  style="text-align: center;  padding-top:12px">
        <asp:TextBox 
            ID="TextBox1" runat="server" 
            Height="47px" Width="487px" TextMode="MultiLine" 
            ValidationGroup="comentar" style="margin-left: 0px" ></asp:TextBox>
        <br />
        <asp:Button ID="Button1" CssClass="g-button g-button-red" runat="server" Text="publicar" ValidationGroup="comentar" OnClick="Comentar" />
    </div>

    <asp:ListView ID="ListView2" runat="server">
        <EmptyDataTemplate>
            <div class="cajaMuro" style="padding-bottom:12px" > No hay entradas en este muro.</div>
        </EmptyDataTemplate>
        <ItemTemplate>
            <div class="caja2" >
            
           <%# 
               
               ((Session["correo"] != null && Session["correo"].ToString() != "") &&
                    (Eval("murReceptor").ToString() == Session["correo"].ToString() ||
                     Eval("murEmisor").ToString() == Session["correo"].ToString())) ?
                                     "<div class='borrar'><a href=\"javascript:borrar('" + Eval("murId") + "')\"><img src=\"Images/btBorrar.png\" /></a></div> " : ""
              %> 
                
                <div class="tituloC">
                <h3> <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# string.Format("~/Muro.aspx?usuario={0}", HttpUtility.UrlEncode(Eval("murEmisor").ToString()))  %>'><asp:Label ID="Label1" runat="server" Text='<%# Eval("usuNombre") + " " +  Eval("usuApellido1") + " " +   Eval("usuApellido2") %>' /></asp:HyperLink>&nbsp;escribió:</h3></div><div class="bodyC"> 
                <asp:Label ID="Label2" runat="server" Text='<%# Eval("murMensaje") %>' ></asp:Label></div><div class="comentarios">
                    <div class="alinearIzquierda"><asp:Label ID="Label4" runat="server" Text='<%# Eval("murFecha") %>'></asp:Label></div><div class="alinearCentro"><asp:HyperLink ID="hlComentarios" runat="server" NavigateUrl='<%# "~/MuroComentario.aspx?id=" + Eval("murId") + "&asig=" + Request.QueryString["codigo"] %>' ><%# Eval("numero").ToString() == "" ? 0 : Eval("numero") %> comentarios</asp:HyperLink></div><asp:LoginView runat="server">
                    <LoggedInTemplate>
                    <div class="botonesMeGusta">
                        <asp:ImageButton ID="ImageButton1" OnClientClick="MasUno" runat="server" Width="20px" Height="20px" ImageUrl="Images/MeGusta.png" ImageAlign="Bottom" OnClick="MasUno"  CommandArgument='<%# Eval("murId") %>' /> 
                        <asp:ImageButton ID="ImageButton2" OnClientClick="MenosUno" runat="server" Width="20px" Height="20px" ImageUrl="Images/NoMegustaRojo.png" ImageAlign="Bottom" OnClick="MenosUno"  CommandArgument='<%# Eval("murId") %>' />
                    </div>
                    </LoggedInTemplate>
                    </asp:LoginView>
                    
                    <div class="alinearDcha"><asp:Label ID="lbPtos" runat="server" Text='<%# Eval("total").ToString() == "" ? 0 : Eval("total") %>' ></asp:Label>&nbsp;puntos</div></div></div></ItemTemplate></asp:ListView></asp:Content>